package com.zzq.my.jetpacks.jectpackapp

import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith

/**
 * Instrumented test, which will execute on an Android device.
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
    @Test
    fun useAppContext() {
        // Context of the app under test.
//        val appContext = InstrumentationRegistry.getInstrumentation().targetContext
//        assertEquals("com.zzq.my.jetpacks.jectpackapp", appContext.packageName)

        val list = listOf(UserInfo("aa"), UserInfo("bb"))

        val list2 = list.map { it.itemType}
       val temp = list.filter { it.age==10 }.forEach {info-> info.itemType=1}
        Log.d("myTag", "list: "+list.toString())
        Log.d("myTag", "list: "+list2.toString())
    }

    data class UserInfo(val name:String="", val age:Int=10, var itemType:Int=0)
}